#include <iostream>
using namespace std;

class Less
{
public:
    bool operator()(int a, int b) const
    {
        return a < b;
    }
};

int main()
{
    Less lessfunc;
    cout << lessfunc(1, 2) << endl;
    cout << lessfunc.operator()(2, 1) << endl;
}

namespace zzy
{
    // 适配器 -- 复用
    template<class Iterator, class Ref, class Ptr>
    struct Reverse_iterator
    {
        Iterator _it;
    };

    template<class Iterator, class Ref, class Ptr>
    Reverse_iterator<Iterator, Ref, Ptr> make_reverse_iterator(Iterator it)
    {
        return Reverse_iterator<Iterator, Ref, Ptr>(it);
    }
    template<class Iterator, class Ref, class Ptr>
    Ref &operator* (Reverse_iterator<Iterator, Ref, Ptr> &it)
    {
        Iterator tmp = it._it;
        return *--tmp;
    }
    template<class Iterator, class Ref, class Ptr>
    Ref *operator-> (Reverse_iterator<Iterator, Ref, Ptr> &it)
    {
        Iterator tmp = it._it;
        return &*--tmp;
    }
    template<class Iterator, class Ref, class Ptr>
    Reverse_iterator<Iterator, Ref, Ptr> operator++ (Reverse_iterator<Iterator, Ref, Ptr> &it)
    {
        --it._it;
        return it;
    }
    template<class Iterator, class Ref, class Ptr>
    Reverse_iterator<Iterator, Ref, Ptr> operator-- (Reverse_iterator<Iterator, Ref, Ptr> &it)
    {
        ++it._it;
        return it;
    }
    // vector和list反向迭代器实现
}